/* BEGIN_COPYRIGHT                                                        */
/*                                                                        */
/* OpenDiameter: Open-source software for the Diameter protocol           */
/*                                                                        */
/* Copyright (C) 2007 Open Diameter Project 				  */
/*                                                                        */
/* This library is free software; you can redistribute it and/or modify   */
/* it under the terms of the GNU Lesser General Public License as         */
/* published by the Free Software Foundation; either version 2.1 of the   */
/* License, or (at your option) any later version.                        */
/*                                                                        */
/* This library is distributed in the hope that it will be useful,        */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of         */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU      */
/* Lesser General Public License for more details.                        */
/*                                                                        */
/* You should have received a copy of the GNU Lesser General Public       */
/* License along with this library; if not, write to the Free Software    */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307    */
/* USA.                                                                   */
/*                                                                        */
/* In addition, when you copy and redistribute some or the entire part of */
/* the source code of this software with or without modification, you     */
/* MUST include this copyright notice in each copy.                       */
/*                                                                        */
/* If you make any changes that are appeared to be useful, please send    */
/* sources that include the changed part to                               */
/* diameter-developers@lists.sourceforge.net so that we can reflect your  */
/* changes to one unified version of this software.                       */
/*                                                                        */
/* END_COPYRIGHT                                                          */
/* 
   diameter_mip4_ha_server_interface.hxx
   Diameter MIP Home Agent server session interface
   Written by Miriam Tauil
   Created December 17, 2004.
*/

#ifndef __DIAMETER_MIP_HA_SERVER_INTERFACE_H__
#define __DIAMETER_MIP_HA_SERVER_INTERFACE_H__
#include <unistd.h>
#include "diameter_parser.h"
#include "diameter_mip4_parser.hxx"

//#include "diameter_mip4_ha_server_session.hxx"




/*************************************************************************
  The DiameterMip4HaServer class specifies an interface for a MIP Home Agent
  Server implementation.
  Once the Home Agent server implementation is implemented with the following 
  interface, the Diameter MIP HA Server sample application, will provide a 
  HA server session implementation supporting the Diameter MIP Application.

 **************************************************************************/


class DiameterMip4HaServer {
   private:
  HAR_Data _harData;
   public:

      DiameterMip4HaServer(){}
        
      virtual ~DiameterMip4HaServer(){}

      //  function to process reg request 

      // return 1 -  mip reg request accepted
      // return 2 -  mip reg request rejected
      // return 3 -  invalid mip reg request 
      // else error ... return values might be added/changed as needed
      virtual int ProcessMipRegRequest( diameter_octetstring_t & MipRegReq )=0;

      /** The following functions will set the passed variable to contain 
         the value set by the Home Agent, if the value cannot be set 
	       return 0,
	       otherwise return 1
      **/

      // called if FA-Ha-Key-Requested: generated by HA
      virtual int SetMipFaToHaSpi(diameter_unsigned32_t &faHaSpi)=0;  
 
      // called if MN-FA-Key-Requested: HA extract value from MipRegRequest
      virtual int SetMipFaToMnSpi(diameter_unsigned32_t &faMnSpi)=0;

      virtual int SetErrorMessage(diameter_utf8string_t &errorMessage){return 0;}

      virtual int SetMipRegReply(diameter_octetstring_t &reply)=0;

      // is called if MN address does not appear in HAR
      virtual int SetMipMnAddress(diameter_address_t &address)=0;

     // Must be populated by HA
      virtual int SetAcctMultiSessionId( diameter_utf8string_t &acctMultiSessionId)=0;

      virtual AAAReturnCode Reset(){ return AAA_ERR_SUCCESS; }

  /* this fn will be call to release local resource allocated to a session
     will be called in the session fn: HandleAbort(), 
     HandleAuthGracePeriodTimeout(), HandleDisconnect, HandleSessiontimeout()
     STR received (where this is captured??)
  */

  virtual void ReleaseSessionResources(){}

  
};
 
#endif  // __DIAMETER_MIP_HA_SERVER_INTERFACE_H__
 
 
